-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build static binary on linux #1862
Conversation
rustup_toolchain: stable | ||
target: 'x86_64-unknown-linux-gnu' | ||
target: 'x86_64-unknown-linux-musl' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would break all the package managers, if you want to add musl, it needs to be another target, not replace the existing one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would it? All the distros compile it themselves, IMO the only use case for a pre-compiled binary is downloading it to some arbitrary system, which we can't make any assumptions about. So it seems to me that for Linux we should ship only static binaries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the distros compile it themselves, IMO the only use case for a pre-compiled binary is downloading it to some arbitrary system, which we can't make any assumptions about
I would rather have both options than only one
So it seems to me that for Linux we should ship only static binaries.
Last time I checked musl, performance was significantly worse. It might have been fixed since then but my results were kinda similar to https://andygrove.io/2020/05/why-musl-extremely-slow/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out, I didn't know. I'll close this PR then.
pool: | ||
vmImage: $(imageName) | ||
steps: | ||
- script: | | ||
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN | ||
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" | ||
displayName: Install rust | ||
condition: ne( variables['Agent.OS'], 'Windows_NT' ) | ||
condition: eq( variables['Agent.OS'], 'Darwin' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Linux the official rust:alpine
image is used, which has all the needed stuff installed. So the only target that needs explicit toolchain installation is Darwin
IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.
The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.
Sanity check:
Code changes
(Delete or ignore this section for documentation changes)
next
branch?If the change is a new feature or adding to/changing an existing one: